<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-09-14 15:13:04
 * @LastEditors: voanit
 * @LastEditTime: 2022-09-14 16:11:54
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex</title>
  <style>
    * {
      padding: 0;
      margin: 0;
      list-style: none;
    }

    ul {
      width: 90px;
      height: 90px;
      background-color: #ccc;
      border-radius: 10px;
      margin: 20px;
      display: flex;
      float: left;
    }

    li {
      width: 20px;
      height: 20px;
      background-color: red;
      border-radius: 50%;
    }

    /* 第一个 */
    ul:nth-child(1) {
      justify-content: center;
      align-items: center;
    }

    /* 第二个 */
    ul:nth-child(2) {
      justify-content: space-around;
      align-items: center;
      flex-direction: column;
    }

    ul:nth-child(3) {
      justify-content: space-around;
      /* align-items: center;
      flex-direction: column; */
    }

    ul:nth-child(3) li {
      margin: 5px;
    }

    ul:nth-child(3) li:nth-child(2) {

      align-self: center;
    }

    ul:nth-child(3) li:nth-child(3) {

      align-self: flex-end;
    }

    ul:nth-child(4) {
      justify-content: space-around;
      flex-wrap: wrap;
    }

    ul:nth-child(4) li {
      margin: 12.5px;
    }

    ul:nth-child(5) {
      justify-content: space-around;
      flex-wrap: wrap;
    }

    ul:nth-child(5) li {
      margin: 5px 12.5px;
    }

    ul:nth-child(5) li:nth-child(3) {
      margin: 5px 35px;
    }

    ul:nth-child(6) {
      justify-content: space-around;
      flex-wrap: wrap;
    }

    ul:nth-child(6) li {
      margin: 5px 12.5px;
    }

    /* flex */

    .box {
      display: flex;
      width: 1200px;
    }

    .first {
      background-color: red;
      /* flex: 1; */
      width: 200px
    }

    .second {
      background-color: greenyellow;
      flex: 2
    }

    .third {
      background-color: blueviolet;
      width: 300px;
    }
  </style>
</head>

<body>
  <ul>
    <li></li>
  </ul>

  <ul>
    <li></li>
    <li></li>
  </ul>
  <ul>
    <li></li>
    <li></li>
    <li></li>
  </ul>
  <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>
  <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>
  <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>
  <div style="clear:both"></div>


  <hr />

  <!-- flex -->
  <div class="box">
    <div class="first">1</div>
    <div class="second">2</div>
    <div class="third">3</div>
  </div>
</body>

</html>